//接口
import { get, post } from './index'
// 管理员登录
export const userlogin = (params) => post('/userlogin', params)



// 菜单列表
export const getMenulist = () => get('/menulist', { istree: true })
//添加菜单
export const menuadd = (params) => post('/menuadd', params)
//删除一条数据
export const menudelete = (id) => post('/menudelete', id)
// 获取一条数据
export const menuinfo = (id) => get('/menuinfo', id)
// 修改一条数据
export const menuedit = (params) => post('/menuedit', params)


// 角色添加
export const roleadd = (params) => post('/roleadd', params)
// 角色列表
export const getRolelist = () => get('/rolelist')
// 角色删除
export const roledelete = (id) => post('/roledelete', id)
// 角色修改
export const roleedit = (params) => post('/roleedit', params)
// 获取一条数据 roleinfo
export const roleinfo = (id) => get('/roleinfo', id)


// 管理员添加
export const useradd = (params) => post("/useradd", params)
// 管理员总数
export const usercount = () => get("/usercount")
// 管理员列表
export const getUserlist = (params) => get("/userlist", params)
// 管理员获取（一条）
export const userinfo = (params) => get("/userinfo", params)
// 管理员修改
export const useredit = (params) => post("/useredit", params)
// 管理员删除
export const userdelete = (id) => post("/userdelete", id)
// // 管理员登录
// export const userlogin = (params) => post("/userlogin", params)


// 商品分类添加
export const cateadd = (params) => post("/cateadd", params, true)
//商品分类列表
export const getCatelist = () => get('/catelist', { istree: true })
//商品分类获取（一条）
export const cateinfo = (params) => get('/cateinfo', params)
//商品分类修改
export const cateedit = (params) => post('/cateedit', params, true)
//商品分类删除
export const catedelete = (params) => post('/catedelete', params)



//  商品规格添加
export const specsadd = (params) => post('/specsadd', params)

// 商品规格总数（用于计算分页）**
export const specscount = () => get('/specscount')

// .商品规格列表（分页）**
export const getSpecslist = (params) => get('/specslist', params)
// 商品规格获取（一条）
export const specsinfo = (params) => get('/specsinfo', params)
// 商品规格修改
export const specsedit = (params) => post('/specsedit', params)
// 商品规格删除
export const specsdelete = (params) => post('/specsdelete', params)



//  商品管理添加
export const goodsadd = (params) => post('/goodsadd', params, true)

// 商品管理总数（用于计算分页）**
export const goodscount = () => get('/goodscount')

// 商品管理列表（分页）**
export const getGoodslist = (params) => get('/goodslist', params)
// 商品管理获取（一条）
export const goodsinfo = (params) => get('/goodsinfo', params)
// 商品管理修改
export const goodsedit = (params) => post('/goodsedit', params, true)
// 商品管理删除
export const goodsdelete = (params) => post('/goodsdelete', params)



// 会员列表
export const getMemberlist = () => get('/memberlist')

// 会员获取（一条）
export const memberinfo = (params) => get('/memberinfo', params)
//会员修改
export const memberedit = (params) => post('/memberedit', params)




// 轮播图管理
// 轮播图列表添加** 
export const banneradd = (params) => post('/banneradd', params, true)
// 轮播图列表** 
export const getBannerlist = () => get('/bannerlist')

//轮播图获取（一条）
export const bannerinfo = (params) => get('/bannerinfo', params)
//轮播图修改
export const banneredit = (params) => post('/banneredit', params, true)
//轮播图删除
export const bannerdelete = (params) => post('/bannerdelete', params)


//限时秒杀管理
// 限时秒杀添加** 
export const seckadd = (params) => post('/seckadd', params)
// 限时秒杀列表** 
export const getSecklist = () => get('/secklist')

//限时秒杀获取（一条）
export const seckinfo = (params) => get('/seckinfo', params)
//限时秒杀修改
export const seckedit = (params) => post('/seckedit', params)
//限时秒杀删除
export const seckdelete = (params) => post('/seckdelete', params)





